package com.gwz.sys.controller;

import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

import com.gwz.sys.domain.Notice;
import com.gwz.sys.service.NoticeService;
import com.gwz.sys.vo.NoticeVo;

@Controller
@RequestMapping("main")
public class IndexController {
	
	@Autowired
	private NoticeService noticeService;
	
	@RequestMapping("index")
	public String index() {
		return "sys/index";
	}
	
	@RequestMapping("desk")
	public String desk() {
		return "sys/desk";
	}
	
	@RequestMapping("toDeptManager")
	public String toDeptManager() {
		return "sys/dept/deptManager";
	}
	
	/**
	 * 跳转部门管理左边菜单树
	 */
	@RequestMapping("toDeptLeft")
	public String toDeptLeft() {
		return "sys/dept/deptLeft";
	}
	
	/**
	 * 跳转部门管理右边列表
	 */
	@RequestMapping("toDeptRight")
	public String toDeptRight() {
		return "sys/dept/deptRight";
	}
	
	/**
	 * 跳转到日志管理
	 */
	@RequestMapping("toLogInfoManager")
	public String toLogInfoManager() {
		return "sys/loginfo/logInfoManager";
	}
	
	/**
	 * 跳转到公告管理
	 */
	@RequestMapping("toNoticeManager")
	public String toNoticeManager() {
		return "sys/notice/noticeManager";
	}
	
	/**
	 * 跳转到添加公告
	 */
	@RequestMapping("toAddNotice")
	public String toAddNotice() {
		return "sys/notice/addNotice";
	}
	
	/**
	 * 跳转到修改公告
	 */
	@RequestMapping("toUpdateNotice")
	public String toUpdateNotice(NoticeVo noticeVo) {
		Notice notice = noticeService.queryNoticeByNoticeId(noticeVo.getId());
		BeanUtils.copyProperties(notice, noticeVo);
		return "sys/notice/updateNotice";
	}
	
	/**
	 * 跳转到查看公告
	 */
	@RequestMapping("toShowNotice")
	public String toShowNotice(NoticeVo noticeVo) {
		Notice notice = noticeService.queryNoticeByNoticeId(noticeVo.getId());
		BeanUtils.copyProperties(notice, noticeVo);
		return "sys/notice/showNotice";
	}
	
	@RequestMapping("toMenuManager")
	public String toMenuManager() {
		return "sys/menu/menuManager";
	}
	
	/**
	 * 跳转菜单管理左边菜单树
	 */
	@RequestMapping("toMenuLeft")
	public String toMenuLeft() {
		return "sys/menu/menuLeft";
	}
	
	/**
	 * 跳转菜单管理右边列表
	 */
	@RequestMapping("toMenuRight")
	public String toMenuRight() {
		return "sys/menu/menuRight";
	}
	
	/**
	 * 跳转到客户管理
	 */
	@RequestMapping("toCustomerManager")
	public String toCustomerManager() {
		return "bus/customer/customerManage";
	}

	/**
	 * 跳转到供应商管理
	 */
	@RequestMapping("toProviderManager")
	public String toProviderManager() {
		return "bus/provider/providerManage";
	}
	
	@RequestMapping("toPermissionManager")
	public String toPermissionManager() {
		return "sys/permission/permissionManager";
	}
	
	/**
	 * 跳转权限管理左边菜单树
	 */
	@RequestMapping("toPermissionLeft")
	public String toPermissionLeft() {
		return "sys/permission/permissionLeft";
	}
	
	/**
	 * 跳转权限管理右边列表
	 */
	@RequestMapping("toPermissionRight")
	public String toPermissionRight() {
		return "sys/permission/permissionRight";
	}
	
	/**
	 * 跳转角色管理
	 */
	@RequestMapping("toRoleManager")
	public String toRoleManager() {
		return "sys/role/roleManager";
	}
	
	@RequestMapping("toUserManager")
	public String toUserManager() {
		return "sys/user/userManager";
	}
	
	/**
	 * 跳转用户管理左边菜单树
	 */
	@RequestMapping("toUserLeft")
	public String toUserLeft() {
		return "sys/user/userLeft";
	}
	
	/**
	 * 跳转用户管理右边列表
	 */
	@RequestMapping("toUserRight")
	public String toUserRight() {
		return "sys/user/userRight";
	}
	
	@RequestMapping("toGoodsManager")
	public String toGoodsManager() {
		return "bus/goods/goodsManager";
	}
	
	/**
	 * 跳转商品管理左边菜单树
	 */
	@RequestMapping("toGoodsLeft")
	public String toGoodsLeft() {
		return "bus/goods/goodsLeft";
	}
	
	/**
	 * 跳转商品管理右边列表
	 */
	@RequestMapping("toGoodsRight")
	public String toGoodsRight() {
		return "bus/goods/goodsRight";
	}
	
	@RequestMapping("toInportManager")
	public String toInportManager() {
		return "bus/inport/inportManager";
	}
	
	@RequestMapping("toOutportManager")
	public String toOutportManager() {
		return "bus/outport/outportManager";
	}
}
